<?php
/**
 * Created by PhpStorm OF yuyi.
 * User: YUYI
 * Date: 2018/5/10 0010
 * Time: 下午 2:51
 * Administrator
 */

namespace app\common\model;



class Users extends BaseModel
{
    protected $pk = 'userId';

    protected $autoWriteTimestamp = 'dateTime';
    protected $createTime = 'createTime';
    protected $updateTime = 'updateTime';

    public function articles()
    {
        return $this->hasMany('Articles','userId');
    }

    public function userGroup()
    {
        return $this->hasOne('Groups','id','groupId')->setEagerlyType(0);
    }

    public function equipments()
    {
        return $this->hasOne('UserEquipments','user_id','userId','ue','left')->setEagerlyType(0);
    }
}